<template>
  <div v-for="(item, index) in test?.list">
    <div v-for="(v, i) in item.books">
      {{ v }}
    </div>
  </div>
  <div>
    <button @click="test.add()">添加</button>
  </div>
</template>
<script>
class Lesson {
  constructor() {
    this.books = []
  }
  add() {
    this.books.push(1)
    return this
  }
}
class Study {
  constructor() {
    this.list = []
  }
  add() {
    this.list.push(new Lesson().add())
    this.list.push(new Lesson().add())
    this.list.push(new Lesson().add())
    this.list.push(new Lesson().add())
    //this.list[0].list.push(new Date())
  }
}
export default {
  data() {
    return {
      test: null
    }
  },
  methods: {},
  mounted() {
    this.test = new Study()
    setTimeout(() => {
      this.test.add()
    }, 1e3)
  }
}
</script>
